// pages/home/vote/components/rank/rank.js
const app = getApp()
var { _get_member_vote_apply_rank_top } = require('../../../../../utils/xiaohuangyu')
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    activityId: {
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    topList: [],
    windowHeight: 0
  },
  lifetimes: {
    // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
    attached: function () {
      console.log(app.globalData.systemInfo)
      this.setData({
        windowHeight: app.globalData.systemInfo.windowHeight
      })
      // top20
      _get_member_vote_apply_rank_top(this.data.activityId, 20, res => {
        console.log('_get_member_vote_apply_top_20', res)
        this.setData({
          topList: res.data
        })
      })
    },
    moved: function () {
      console.log('moved')
    },
    detached: function () {
      console.log('detached')
    },
  },
  /**
   * 组件的方法列表
   */
  methods: {

  }
})
